package chpt06;

import java.util.Deque;
import java.util.LinkedList;

public class QueueDemo03 {

	public static void main(String[] args) {
		Deque<String> deque = new LinkedList<>();
		deque.offerLast("end");  // 添加到队尾
		deque.offerFirst("C");   // 添加到队首
		deque.offerFirst("B");
		deque.offerFirst("A");
		while(!deque.isEmpty()) {
			System.out.println(deque.pollLast());
			System.out.println(deque.pollFirst());
		}
	}
}
